package com.lmabbe.core.common.entitys;

import com.baomidou.mybatisplus.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsNativeDefValue;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.lmabbe.common.global.constant.GlobalConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统参数表
 *
 * @author lmabbe
 * @TableName sys_ params
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(isSimple = true, comment = "系统参数表")
public class SysParams implements Serializable {

    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Column(isKey = true, isNull = false, length = 32, comment = "参数ID")
    private Long paramId;

    @TableField()
    @Column(comment = "参数名称")
    private String paramName;

    @TableField()
    @Column(comment = "参数key")
    private String paramKey;

    @TableField()
    @Column(comment = "参数值")
    private String paramValue;

    @TableField()
    @Column(comment = "值类型(1.txt 2.image 3.URL)", defaultValue = "1")
    private Integer valueType;

    @TableField()
    @Column(comment = "是否是只读", type = MySqlTypeConstant.TINYINT, defaultValue = "0")
    private Boolean readonly;

    /**
     * 是否有效(1.有效 0.无效 -1.软删除)
     */
    @TableField()
    @Column(comment = "是否有效(1.有效 0.无效 -1.软删除)", defaultValue = "1")
    @TableLogic(value = GlobalConstant.IS_VALID.YES_STR, delval = GlobalConstant.IS_VALID.DELETE_STR)
    private Integer valid;

    /**
     * 创建人
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @TableField(fill = FieldFill.INSERT)
    @Column(isNull = false, comment = "创建人", defaultValue = "system")
    private String createBy;
    /**
     * 创建时间
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @IsNativeDefValue
    @TableField(fill = FieldFill.INSERT)
    @Column(isNull = false, comment = "创建时间", type = MySqlTypeConstant.TIMESTAMP, defaultValue = "CURRENT_TIMESTAMP")
    private Date createTime;
    /**
     * 修改人
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(isNull = false, comment = "修改人", defaultValue = "system")
    private String modifyBy;
    /**
     * 修改时间
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @IsNativeDefValue
    @Column(isNull = false, comment = "修改时间", type = MySqlTypeConstant.TIMESTAMP, defaultValue = "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;
}
